
	class Hand {
		private int ace,two,three,four,five,six,seven,eight,nine;
		private int ten,jack,queen,king,heart,diamond,club,spade;

		//No constructor is needed

		//Methods:


		//Method to ensure the program has five ranks, and five suits submitted
		public boolean correctHand(){
			return(((this.ace + this.two + this.three + this.four + this.five + this.six + this.seven + 
					this.eight + this.nine + this.ten + this.jack + this.queen + this.king) == 5)&& 
					(this.heart + this.diamond + this.club + this.spade == 5));
		}

		//Method to check if any card was entered more than once
		public boolean checkDuplicates(Card other1, Card other2, Card other3, Card other4, Card other5){
			return (other1.getCard().equals(other2.getCard()) || other1.getCard().equals(other3.getCard()) || other1.getCard().equals(other4.getCard()) || 
					other1.getCard().equals(other5.getCard()) || other2.getCard().equals(other3.getCard()) || other2.getCard().equals(other4.getCard()) || 
					other2.getCard().equals(other5.getCard()) || other3.getCard().equals(other4.getCard()) || other3.getCard().equals(other5.getCard()) || other4.getCard().equals(other5.getCard()));
		}
		
		//Method to calculate what card has been submitted, and enters them into Hand class
		public void set(Card other){
			if (other.getNumber().charAt(0) == 'a'){	//If letter starts with 'a', presumed to be ace
				this.ace = this.ace + 1;		//If ace: add 1 to total amount of aces
			}
			if (other.getNumber().equals("two") || other.getNumber().equals("2")){ //Allows user to enter either "two" or "2"
				this.two = this.two + 1;		//If two: add 1 to total amount of twos
			}
			if (other.getNumber().equals("three") || other.getNumber().equals("3")){ //Allows user to enter either "three" or "3"
				this.three = this.three + 1;	//If three: add 1 to total amount of threes
			}
			if (other.getNumber().equals("four") || other.getNumber().equals("4")){	//Allows user to enter either "four" or "4"
				this.four = this.four + 1;		//If four: add 1 to total amount of fours
			}
			if (other.getNumber().equals("five") || other.getNumber().equals("5")){ //Allows user to enter either "five" or "5"
				this.five = this.five + 1;		//If five: add 1 to total amount of fives
			}
			if (other.getNumber().equals("six") || other.getNumber().equals("6")){ //Allows user to enter either "six" or "6"
				this.six = this.six + 1;		//If six: add 1 to total amount of sixes
			}
			if (other.getNumber().equals("seven") || other.getNumber().equals("7")){ //Allows user to enter either "seven" or "7"
				this.seven = this.seven + 1;	//If seven: add 1 to total amount of sevens
			}
			if (other.getNumber().equals("eight") || other.getNumber().equals("8")){ //Allows user to enter either "eight" or "8"
				this.eight = this.eight + 1 ;	//If eight: add 1 to total amount of eights
			}
			if (other.getNumber().equals("nine") || other.getNumber().equals("9")){	//Allows user to enter either "nine" or "9"
				this.nine = this.nine + 1;		//If nine: add 1 to total amount of nines
			}
			if (other.getNumber().equals("ten") || other.getNumber().equals("10")){	//Allows user to enter either "ten" or "10"
				this.ten = this.ten + 1;		//If ten: add 1 to total amount of tens
			}
			if (other.getNumber().equals("jack")){
				this.jack = this.jack + 1 ;		//If jack: add 1 to total amount of jacks
			}
			if (other.getNumber().equals("queen")){
				this.queen = this.queen + 1;	//If queen: add 1 to total amount of queens
			}
			if (other.getNumber().equals("king")){
				this.king = this.king + 1;		//If king: add 1 to total amount of kings
			}
			
			
			if (other.getSuit().charAt(0) == 'h'){	//If suit is a heart
				this.heart = this.heart + 1;			//Add 1 to the total amount of hearts
			}
			if (other.getSuit().charAt(0) == 'd'){	//If suit is a diamond
				this.diamond = this.diamond + 1;		//Add 1 to the total amount of diamonds
			}
			if (other.getSuit().charAt(0) == 'c'){	//If suit is a club
				this.club = this.club + 1;				//Add 1 to the total amount of clubs
			}
			if (other.getSuit().charAt(0) == 's'){	//If suit is a spade
				this.spade = this.spade + 1;			//Add 1 to the total amount of spades
			}
		}
		
		public boolean checkPair(){	//Method to check if hand is a pair, looks for ranks with total amounts of '2'
			return(this.ace == 2 || this.two == 2 || this.three == 2 || this.four == 2 || this.five == 2 || this.six == 2 || this.seven == 2 || 
					this.eight == 2 || this.nine == 2 || this.ten == 2 || this.jack == 2 || this.queen == 2 || this.king == 2);
		}
		
		
		public boolean checkTwoPair(){
		/*Method to check if there are two pairs. Checks if a rank is equal to and if it is, then it will check if another rank is equal to 2.*/
			if(this.ace == 2){
				return(this.two == 2 || this.three == 2 || this.four == 2 || this.five == 2 || this.six == 2 || this.seven == 2 || this.eight == 2 || this.nine == 2 || this.ten == 2 || this.jack == 2 || this.queen == 2 || this.king == 2);
			}
				else if(this.two == 2){
					return(this.three == 2 || this.four == 2 || this.five == 2 || this.six == 2 || this.seven == 2 || this.eight == 2 || this.nine == 2 || this.ten == 2 || this.jack == 2 || this.queen == 2 || this.king == 2);
				}
				else if (this.three == 2){
					return(this.four == 2 || this.five == 2 || this.six == 2 || this.seven == 2 || this.eight == 2 || this.nine == 2 || this.ten == 2 || this.jack == 2 || this.queen == 2 || this.king == 2);
				}
				else if (this.four == 2){
					return(this.five == 2 || this.six == 2 || this.seven == 2 || this.eight == 2 || this.nine == 2 || this.ten == 2 || this.jack == 2 || this.queen == 2 || this.king == 2);
				}
				else if (this.six == 2){
					return(this.seven == 2 || this.eight == 2 || this.nine == 2 || this.ten == 2 || this.jack == 2 || this.queen == 2 || this.king == 2);
				}
				else if (this.seven == 2){
					return(this.eight == 2 || this.nine == 2 || this.ten == 2 || this.jack == 2 || this.queen == 2 || this.king == 2);
				}
				else if (this.eight == 2){
					return(this.nine == 2 || this.ten == 2 || this.jack == 2 || this.queen == 2 || this.king == 2);
				}
				else if(this.ten == 2){
					return(this.jack == 2 || this.queen == 2 || this.king == 2);
				}
				else if (this.jack == 2){
					return(this.queen == 2 || this.king == 2);
				}
				else{
					return (this.queen == 2 && this.king == 2);
				}
			}
		
			//Method to check for three of a kind: looks for a rank with a total of '3'.
		public boolean checkThreeofaKind(){
			return(this.ace == 3 || this.two == 3 || this.three == 3 || this.four == 3 || this.five == 3 || this.six == 3 || this.seven == 3 || 
					this.eight == 3|| this.nine == 3 || this.ten == 3|| this.jack == 3 || this.queen == 3 || this.king ==3); 
		}
		
		public boolean checkStraight(){
			return ((this.ace == 1 && this.two == 1 && this.three == 1 && this.four == 1 && this.five == 1) ||
					(this.two == 1 && this.three == 1 && this.four == 1 && this.five == 1 && this.six == 1) ||
					(this.three == 1 && this.four == 1 && this.five == 1 && this.six == 1 && this.seven == 1) ||
					(this.four == 1 && this.five == 1 && this.six == 1 && this.seven == 1 && this.eight == 1) ||
					(this.five == 1 && this.six == 1 && this.seven == 1 && this.eight == 1 && this.nine == 1) ||
					(this.six == 1 && this.seven == 1 && this.eight == 1 && this.nine == 1 && this.ten == 1) ||
					(this.seven == 1 && this.eight == 1 && this.nine == 1 && this.ten == 1 && this.jack == 1) ||
					(this.eight == 1 && this.nine == 1 && this.ten == 1 && this.jack == 1 && this.queen == 1)||
					(this.nine == 1 && this.ten == 1 && this.jack == 1 && this.queen == 1 && this.king == 1)||
					(this.ten == 1 && this.jack == 1 && this.queen == 1 && this.king == 1 && this.ace == 1));
		}
		
		public boolean checkPoker(){
			return(this.ace == 4 || this.two == 4 || this.three == 4 || this.four == 4 || this.five == 4 || this.six == 4|| this.seven == 4 || 
					this.eight == 4 || this.nine == 4 || this.ten == 4 || this.jack == 4 || this.queen == 4 || this.king == 4);
		}
		
		public boolean checkFullHouse(){
			return (checkPair() && checkThreeofaKind());
		}
		public boolean checkFlush(){
			return(this.heart == 5 || this.diamond == 5 || this.club == 5 || this.spade == 5);
		}
		
		public boolean checkStraightFlush(){
			return (checkStraight() && checkFlush());
		}
		
		public boolean checkRoyalFlush(){
			return ((this.ten == 1 && this.jack == 1 && this.queen == 1 && this.king == 1 && this.ace == 1) && checkFlush());
		}
		
		public String getHand(){
			if (checkRoyalFlush() == true){
				return ("royal flush");
			}
			else if (checkStraightFlush() == true){
				return ("straight flush");
				}
			else if (checkPoker() == true){
				return ("poker");
				}
			else if (checkFullHouse() == true){
				return ("full house");
				}
			else if (checkFlush() == true){
				return ("flush");
				}
			else if (checkStraight() == true){
				return ("straight");
				}
			else if (checkThreeofaKind() == true){
				return ("three of a kind");
				}
			else if (checkTwoPair() == true){
				return("two pair");
				}
			else if (checkPair() == true){
				return("pair");
				}
				else{
					return ("high card");
					}
			}
}